package com.platform.api.dao;


import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;

import com.platform.api.entity.CouponVo;
import com.platform.common.dao.BaseDao;
import org.springframework.stereotype.Repository;

/**
 * @author lipengjun
 * @email 939961241@qq.com
 * @gitee https://gitee.com/fuyang_lipengjun/platform
 * @date 2017-08-11 09:16:46
 */
@Mapper
@Repository
public interface ApiCouponMapper extends BaseDao<CouponVo> {
    int save(CouponVo t);
    void save(Map<String, Object> map);
    void saveBatch(List<CouponVo> list);
    int update(CouponVo t);
    int update(Map<String, Object> map);
    int delete(Object id);
    int delete(Map<String, Object> map);
    int deleteBatch(Object[] id);
    CouponVo queryObject(Object id);
    List<CouponVo> queryList(Map<String, Object> map);
    List<CouponVo> queryList(Object id);
    int queryTotal(Map<String, Object> map);
    int queryTotal();
    /**
     * 按条件查询用户优惠券
     *
     * @param params
     * @return
     */
    List<CouponVo> queryUserCoupons(Map<String, Object> params);

    /**
     * 按条件查询用户优惠券
     *
     * @param id
     * @return
     */
    CouponVo getUserCoupon(Integer id);

    /**
     * 按类型查询
     *
     * @param params
     * @return
     */
    CouponVo queryMaxUserEnableCoupon(Map<String, Object> params);

    /**
     * sendType = 1或4 的优惠券
     *
     * @param params
     * @return
     */
    List<CouponVo> queryUserCouponList(Map<String, Object> params);

    int updateUserCoupon(CouponVo couponVo);
}
